//
//  AddGroupMemberTableViewCell.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/4/5.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "AddGroupMemberTableViewCell.h"

@implementation AddGroupMemberTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addMySubview];
    }
    return self;
}

// 布局
- (void)addMySubview
{
    self.isSelectImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 21 * kAdjustParamater, 22 * kAdjustParamater, 22 * kAdjustParamater)];
  //  self.isSelectImageV.backgroundColor = [UIColor redColor];
    self.isSelectImageV.layer.cornerRadius = self.isSelectImageV.width / 2;
    self.isSelectImageV.layer.masksToBounds = YES;
    [self.contentView addSubview:_isSelectImageV];
    
    self.friendImage = [[UIImageView alloc] initWithFrame:CGRectMake(self.isSelectImageV.right + 17 * kAdjustParamater, 15 / 2 * kAdjustParamater, 50 * kAdjustParamater, 50 * kAdjustParamater)];
    self.friendImage.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    self.friendImage.layer.cornerRadius = self.friendImage.width / 2;
    self.friendImage.layer.masksToBounds = YES;
    [self.contentView addSubview:_friendImage];
    
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.friendImage.right + 11 * kAdjustParamater, 22 * kAdjustParamater, 200 * kAdjustParamater, 20 * kAdjustParamater)];
   // self.nameLabel.backgroundColor = [UIColor redColor];
    self.nameLabel.textColor = [UIColor blackColor];
    self.nameLabel.font = [UIFont systemFontOfSize:k16Big];
    self.nameLabel.textAlignment = NSTextAlignmentLeft;
    [self.contentView addSubview:_nameLabel];
    
}


- (void)setModel:(SelectFriendModel *)model
{
    if (model.isSelect == YES) {
        self.isSelectImageV.image = [UIImage imageNamed:@"xuanzhong-create"];
    } else {
        self.isSelectImageV.image = [UIImage imageNamed:@"weixuanzhong-createGroup"];
    }
    self.friendImage.image = [UIImage imageNamed:model.picture];
    self.nameLabel.text = model.name;
}


@end
